def calculator():
    print("简单计算器（支持加减乘除）")
    print("请输入第一个数字：")
    num1 = float(input())
    
    print("请选择运算符（+、-、*、/）：")
    operator = input()
    
    print("请输入第二个数字：")
    num2 = float(input())
    
    if operator == '+':
        result = num1 + num2
    elif operator == '-':
        result = num1 - num2
    elif operator == '*':
        result = num1 * num2
    elif operator == '/':
        if num2 == 0:
            print("错误：除数不能为0！")
            return
        result = num1 / num2
    else:
        print("错误：无效的运算符！")
        return
    
    print(f"计算结果：{num1} {operator} {num2} = {result}")

# 调用计算器函数
calculator()